import { msg } from '../notice/notice';

Template.feedback_modal.events({
  'click #submit-feedback' (e) {
    const text = $('#feedback-modal-input').val().trim();
    if (text && text != '') {
      Meteor.call('feedback', { details: { text } }, (err, res) => {
        if (res) {
          $('#feedback-modal-input').val('');
          msg({content: '我们已收到你的反馈，谢谢'});
          $('#feedback-modal').modal('hide');
        }
      });
    }
  }
});